<template>
<view class="Global">
	<!-- <image class="imagepage" src="/static/background@2x.png" mode=""></image> -->
	<bgImage></bgImage>
		<MyNav :title="title" bgColor="" :backIcon="isback"></MyNav>


	</view>
</template>

<script>
	import MyNav from '@/components/customnavbar.vue'
	import bgImage from '@/components/backgroundImage.vue'

	export default {
		components: {
			MyNav,
			bgImage
		},
		data() {
			return {


				title: '扫码',

				isback: true,

			}
		},

		onReady() {
			// 允许从相机和相册扫码

			uni.scanCode({
				success:  (res)=> {
					console.log('条码类型：' + res.scanType);
					console.log('条码内容：' + res.result);

					// 跳转到报工入菲
					this.workInThePhilippines(res.result);
				}
			});
		},
		methods: {

			workInThePhilippines(code){
				uni.navigateTo({
					url: '/subPack/workInThePhilippines/workInThePhilippines/workInThePhilippines?code=' + encodeURIComponent(JSON.stringify(code)),
					success: res => {},
					fail: () => {},
					complete: () => {}
				});
			}

		}
	}
</script>

<style>

</style>
